package com.example.demo.controller;

import com.example.demo.model.User;
import com.example.demo.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
//    方法1 属性注入
    @Autowired
    private UserService userService;

    @Resource(name="user2")
    private User user;
    public void say(){
        System.out.println("this is UserController");
        System.out.println(user);
    }


}
